package com.zaki.controller;

import com.github.pagehelper.PageInfo;
import com.zaki.model.Result;
import com.zaki.model.User;
import com.zaki.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/list")
    public Result list(Integer pageSize, Integer pageNum){
        PageInfo<User> userList =userService.selectList(pageSize,pageNum);
        return Result.success(userList);
    }
}
